'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = serializeObj;

var _serializeArray = require('./serializeArray');

var _serializeArray2 = _interopRequireDefault(_serializeArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * 以对象形式获取表单数据
 * @param {Selector | Element} form
 * @returns {Object}
 */
function serializeObj(form) {
    var arr = (0, _serializeArray2.default)(form);
    var obj = {};
    arr.forEach(function (o) {
        obj[o.name] = o.value;
    });
    return obj;
}